<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>兼容性测试</title>
</head>
<body>
    <div class="className" id="xiangqin">2017、7、24</div>
    <script>
        console.log("ie8");
//        IE9下不能用个体ElementByClassName，dom扩展Html5才有
        console.log(document.getElementsByClassName("className")[0].innerHTML);

//        innerHTML也是IE9+，dom扩展html5才有
        console.log(document.getElementById("xiangqin").innerHTML);
    </script>

</body>
</html>